package cn.dnuihyy406.dnuifood_16110100406.model;

import java.util.List;

import cn.dnuihyy406.dnuifood_16110100406.bean.CollectBean;
import cn.dnuihyy406.dnuifood_16110100406.bean.CollectStatus;
import cn.dnuihyy406.dnuifood_16110100406.bean.FoodBean;
import cn.dnuihyy406.dnuifood_16110100406.bean.ResultBean;
import cn.dnuihyy406.dnuifood_16110100406.iface.FoodIface;
import cn.dnuihyy406.dnuifood_16110100406.listener.OnRetrofitListener;
import cn.dnuihyy406.dnuifood_16110100406.service.CollectService;
import cn.dnuihyy406.dnuifood_16110100406.service.FoodService;
import retrofit2.Call;

public class FoodModel extends BaseModel implements FoodIface {
    private FoodService Service;
    private CollectService collectService;
    public FoodModel() {
        super();
        Service=retrofit.create(FoodService.class);
        collectService=retrofit.create(CollectService.class);
    }

    @Override
    public void getFoodByShop(String shop_id, OnRetrofitListener listener) {
        Call call = Service.getFoodByShop(shop_id);
        bindCallBack(call,listener,2);
    }

    @Override
    public void isCollected(String user_id, String shop_food_id, String flag, OnRetrofitListener listener) {
        Call<CollectStatus> call = collectService.isCollected(user_id,shop_food_id,flag);
        bindCallBack(call,listener,3);
    }

    @Override
    public void userCollectShop(String user_id, String shop_id, OnRetrofitListener listener) {
        Call<ResultBean> call = collectService.userCollectShop(user_id,shop_id);
        bindCallBack(call,listener,4);
    }


}
